package dashboard.utils;

import java.math.BigDecimal;

/**
 * 
 * simple introduction
 * 
 * <p>
 * detailed comment
 * 
 * @author guolu 2015-1-26
 * @see
 * @since 1.0
 */
public class DNumberUtils {


	public static String format(int n) {
		return Integer.toString(n);
	}

	public static String format(double d) {

		return String.format("%.2f", d);

	}

	public static double formatDouble(double d) {
		BigDecimal bg = new BigDecimal(d);
		return bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
	}
}
